alias x {
  sockclose server*
  sockclose conn*
  sockclose abce*
  socklisten server 6668
  socklisten conn 6666
  server 127.0.0.1 6666
  sockopen abce 207.68.167.253 6667
}
on 1:socklisten:conn:sockaccept connection | sockclose conn
on 1:socklisten:server:sockaccept blah | sockclose server
on 1:sockread:blah:{
  if ($sockerr > 0) return
  sockread %tmp.1
  echo -s %tmp.1
  if (FINDS != $gettok(%tmp.1,1,32)) sockwrite -n abce %tmp.1
  else {
    sockwrite -n abce FINDS $chr(37) $+ #testingxx 
  }
}
on 1:sockread:abce:{
  sockread %tmp.2
  echo -s %tmp.2
  if (:207.68.167 !isin %tmp.2) sockwrite -n blah %tmp.2
  else {
    socklisten server2 6668
    sockopen abce1 $remove($gettok(%tmp.2,4,32),:) 6667
    .timer 1 2 sockwrite -n blah :cpchatwbe02 613 nickname :127.0.0.1 6668
    .timer 1 3 sockclose blah
    .timer 1 3 sockclose abce
  }
}
on 1:socklisten:server2:sockaccept blah2 | sockclose server2
on 1:sockread:blah2:{
  if ($sockerr > 0) return
  sockread %tmp.3
  echo -s %tmp.3
  if (NICK != $gettok(%tmp.3,1,32)) sockwrite -n abce1 %tmp.3
  else sockwrite -n abce1 NICK $me
}
on 1:sockread:abce1:{
  if ($sockerr > 0) return
  sockwrite -n abce1 NICK $me
  sockread %tmp.4
  echo -s %tmp.4
  sockwrite -n blah2 %tmp.4
  if (Welcome isin %tmp.4) {
    sockrename abce1 connected
    .timer 1 0 sockwrite -n * :cpmsnchata04 004 sdfasdf cpmsnchata03 5.5.0 aioxz abcdefhiklmnoprstuvxyz 9 $+ $me $+ 
    .timer 1 0 sockclose blah2
  }
}
on 1:sockread:connected:{
  if ($sockerr > 0) return
  sockread %sock.tmp
  if (1.1.0 isin %sock.tmp) { sockwrite -n connection $replace(%sock.tmp,1.1.0,5.5.0) | halt }
  elseif (PRIVMSG == $gettok(%sock.tmp,2,32)) {
    if ($gettok(%sock.tmp,4,32) != :S) sockwrite -n connection %sock.tmp
    else sockwrite -n connection $gettok(%sock.tmp,1-3,32) : $+ $remove($gettok(%sock.tmp,6-,32),)
  }
  elseif (353 == $gettok(%sock.tmp,2,32)) {
    var %a = 6
    var %b
    while (%a <= $numtok(%sock.tmp,32)) {
      if (%b == $null) %b = $remove($gettok($gettok(%sock.tmp,%a,32),4,44),:)
      else %b = %b $gettok($gettok(%sock.tmp,%a,32),4,44)
      inc %a
    }
    sockwrite -n connection :cpmsnchatb04 353 $me = $gettok(%sock.tmp,5,32)) : $+ %b
  }
  else sockwrite -n connection %sock.tmp
}
on 1:sockread:connection:{
  if ($sockerr > 0) return
  sockread %sock2.tmp
  sockwrite -n connected %sock2.tmp 
}
dialog msnlogin {
  title "Msn Passport Parser"
  size -1 -1 202 104
  option dbu
  edit "", 4, 44 28 150 10,autohs
  text "RegCookie:", 5, 3 29 27 8
  text "Passport Ticket", 6, 3 40 37 8
  edit "", 7, 44 39 150 10,autohs
  text "Passport Profile", 8, 3 51 37 8
  edit "", 9, 44 50 150 10,autohs
  text "Nickname:", 10, 12 68 25 8
  edit "", 11, 41 67 51 10,autohs
  text "Channel:", 12, 97 68 25 8
  edit "", 13, 122 67 70 10,autohs
  button "Generate Html File", 14, 39 87 89 16, ok
  button "Parse File", 15, 77 6 52 15
  check "Launch generated file", 16, 134 91 64 9
}

alias msnlogin $iif($dialog(msnlogin) == $null,dialog -m msnlogin msnlogin,dialog -v msnlogin msnlogin)
on *:DIALOG:msnlogin:init:*:{
  checkbuttons
  if (%msnlogin.nick) did -ra $dname 11 $ifmatch
  if (%msnlogin.chan) did -ra $dname 13 $ifmatch
}
on *:DIALOG:msnlogin:sclick:15:{
  var %file = $sfile($shortfn(C:\windows\desktop\),Select)
  $msnparse($shortfn(%file))
}
on *:DIALOG:msnlogin:sclick:14:genloginpage
on *:DIALOG:msnlogin:edit:*:checkbuttons
alias -l msnparse {
  unset %msnlogin.*
  if ($read($1-,w,*msnregcookie*)) set %msnlogin.regcookie $ifmatch
  if ($read($1-,w,*PassportTicket*)) set %msnlogin.passticket $ifmatch
  if ($read($1-,w,*PassportProfile*)) set %msnlogin.passprofile $ifmatch
  if ($msnloginerror) {
    var %m1 = $remove(%msnlogin.regcookie,<PARAM NAME="MSNREGCookie" VALUE=",">';), $&
      %m1 = $remove(%m1,temp += '), $&
      %m2 = $remove(%msnlogin.passticket,<PARAM NAME="PassportTicket" VALUE=",">';), $&
      %m2 = $remove(%m2,temp += '), $&
      %m3 = $remove(%msnlogin.passprofile,<PARAM NAME="PassportProfile" VALUE=",">';), $&
      %m3 = $remove(%m3,temp += ')
    set %msnlogin.regcookie %m1
    set %msnlogin.passticket %m2
    set %msnlogin.passprofile %m3   
    did -ra $dname 4 %m1   
    did -ra $dname 7 %m2
    did -ra $dname 9 %m3   
    checkbuttons
  }
}

alias -l msnloginerror {
  var %x = 1
  if (!%msnlogin.regcookie) var %x = 2
  if (!%msnlogin.passticket) var %x = 2
  if (!%msnlogin.passprofile) var %x = 2
  if (%x == 2) {
    echo -a ERROR: The MSN login script could not find one of the required values in the file you selected. The required values are: MSNREGCookie, PassportTicket, PassportProfile
    return $false
  }
  if (%x == 1) return $true
}

alias -l checkbuttons {
  var %x = 1
  if (!$did($dname,4).text) var %x = 2
  if (!$did($dname,7).text) var %x = 2
  if (!$did($dname,9).text) var %x = 2
  if (!$did($dname,13).text) var %x = 2
  if (!$did($dname,11).text) var %x = 2
  if (%x == 1) did -e $dname 14
  else did -b $dname 14
}

alias -l genloginpage {
  var %chan = $remove($did($dname,13).text,$chr(37),$chr(35))
  set %msnlogin.chan1 $chr(37) $+ $chr(35) $+ %chan
  set %msnlogin.chan2 %chan
  set %msnlogin.nick $remove($did($dname,11).text,$chr(62))
  ;-
  .remove msnlogin.html
  $w.html(<HTML><BODY STYLE="margin:0">)
  $w.html(<OBJECT ID="ChatFrame" CLASSID="CLSID:81361155-FAF9-11d3-B0D3-00C04F612FF1" WIDTH="100%" HEIGHT="100%">)
  $w.html(<!-- OBJECT ID="ChatFrame" CLASSID="CLSID:81361155-FAF9-11d3-B0D3-00C04F612FF1" WIDTH="100%" HEIGHT="100%">)
  $w.html(<PARAM NAME="RoomName" VALUE=" $+ %chan $+ ">)
  $w.html(<PARAM NAME="MSNREGCookie"  VALUE=" $+ %msnlogin.regcookie $+ ">)
  $w.html(<PARAM NAME="PassportTicket" VALUE=" $+ %msnlogin.passticket $+ ">)
  $w.html(<PARAM NAME="PassportProfile" VALUE=" $+ %msnlogin.passprofile $+ ">)
  $w.html(<PARAM NAME="NickName" VALUE=" $+ %msnlogin.nick $+ ">)
  $w.html(<PARAM NAME='BaseURL' VALUE='http://chat.msn.com/'>)
  $w.html(<PARAM NAME="Server" VALUE="127.0.0.1:6668">)
  $w.html(</BODY></HTML>)
  if ($did($dname,16).state) {
    run msnlogin.html
    editbox -a /x
  }
  unset %msnlogin.*
  set %msnlogin.nick $did($dname,11).text
  set %msnlogin.chan %chan
  if ($server) disconnect
  nick $remove($did($dname,11).text,$chr(62))
}
alias -l w.html return write msnlogin.html $1-

menu menubar {
  -
  MSN Passport
  .Help://echo How to get the source code... On the menu bar click Guardian, MSN Passport, Get passport information. Two things will open, A list window and a Passport Parser. In the List window three things may happen, it signs you in, its blank, or a sign in box appears. If it signed you in allready join a room in the list window, then right click the page and choose view source. Then save as a text file on your desktop. Then sign out. You can close the list window. On the Passport Parser click Parse File and point it to the saved text file on the desktop. You will see the empty boxes fill. Add your nicknameand chanel. Close the parser. Then in the menu bar under MSN Passport click Connect to MSN Server. If the list window is blank, right click and refresh. Then follow the above instructions. If the sign is box appears, sign in and follow the above steps. Dont forget to also add your nickname in the irc options.
  .-
  .Get Passport Information:/msnlogin | /listo
  .Connect To MSN IRC Server:/listlog | /x
  .-
  .Edit Login Exploit (Not Advised):/run notepad.exe $mircdir $+ msnlogin.html
  List MSN Chanels
  .City Chats:/lista
  .Computing:/listb
  .Entertainment:/listc
  .General:/listd
  .Health Medicine:/liste
  .Interests:/listf
  .Lifestyles:/listg
  .Music:/listh
  .News:/listi
  .Peers:/listj
  .Religion:/listk
  .Romance:/listl
  .Sports Recreation:/listm
  .Teens:/listn
  -
  Url Decoder:/listdec
  -
}
alias -l listdec {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,$mircdir $+ Decoder.htm)
}
alias -l listlog {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,$mircdir $+ msnlogin.html)
}
alias -l lista {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=GE)
}
alias -l listb {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=CP)
}
alias -l listc {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=EA)
}
alias -l listd {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=GN)
}
alias -l liste {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=HE)
}
alias -l listf {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=II)
}
alias -l listg {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=LF)
}
alias -l listh {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=MU)
}
alias -l listi {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=NW)
}
alias -l listj {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=PR)
}
alias -l listk {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=RL)
}
alias -l listl {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=RM)
}
alias -l listm {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=SP)
}
alias -l listn {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://chat.msn.com/find.msnw?cat=TN)
}

alias -l listo {
  if ($window(@list)) close -p @list
  window -p @List
  var %x = $dll(nHTMLn,attach,$window(@list).hwnd), $&
    %x = $dll(nHTMLn,navigate,http://login.passport.com/login.srf?lc=2057&id=2208&)
}
ctcp ^*:version:/ctcpreply $nick VERSION Guardian v1.0 (By CyBah) [cybah911@msn.com]
on *:start: {
  /echo 11*  Guardian is Loaded!
  /ECHO  =============================================================================================
  /ECHO 11*  Guardian V1.0 [BY Cybah (cybah911@msn.com)]
  /echo 11*  This script will connect you to the MSN web chat server. Check the tool bar!) 
  /echo 11*  Script Info: Guardian V1.0 44Automated Passport Script
  /echo 11*  Special thanks to Dasnk for the Passport Parser code and his help with the script. [ gemz25@hotmail.com ]
  /echo 11*  Any questions or comments can be directed to my email.
  /echo 11*  Logged on at $time([h:nn TT])  $date(ddd/mmm/yyyy) 
  /titlebar ......Guardian V1.0 [BY Cybah (cybah911@msn.com)
  /ECHO  ============================================================================================= 
}
